package view;

import java.sql.SQLException;
import java.util.Observable;
import java.util.Observer;

import model.database.Database;

public class DatabaseListener implements Observer {

	public DatabaseListener(Database database) {
		database.addObserver(this);
	}

	public void update(Observable arg0, Object arg1) {
		if (arg1 instanceof SQLException) {
			SQLException ex = (SQLException) arg1;
			System.out.println(ex.getMessage());
			System.out.println();
		} else if (arg1 instanceof String) {
			String a = (String) arg1;
			System.out.println(a);
			System.out.println();
		}
	}
}
